/*    */ package net.sourceforge.appgen.util;
/*    */ 
/*    */ import java.io.BufferedInputStream;
/*    */ import java.io.BufferedOutputStream;
/*    */ import java.io.File;
/*    */ import java.io.FileInputStream;
/*    */ import java.io.FileOutputStream;
/*    */ import java.io.IOException;
/*    */ import java.io.InputStream;
/*    */ import java.io.OutputStream;
/*    */ 
/*    */ public class FileUtils
/*    */ {
/*    */   public static final int BUFFER_SIZE = 4096;
/*    */ 
/*    */   public static String ln()
/*    */   {
/* 36 */     return System.getProperty("line.separator", "\n");
/*    */   }
/*    */ 
/*    */   public static int copy(File in, File out) throws IOException {
/* 40 */     return copy(new BufferedInputStream(new FileInputStream(in)), new BufferedOutputStream(new FileOutputStream(out)));
/*    */   }
/*    */ 
/*    */   public static int copy(InputStream in, OutputStream out) throws IOException {
/*    */     try {
/* 45 */       int byteCount = 0;
/* 46 */       byte[] buffer = new byte[4096];
/* 47 */       int bytesRead = -1;
/* 48 */       while ((bytesRead = in.read(buffer)) != -1) {
/* 49 */         out.write(buffer, 0, bytesRead);
/* 50 */         byteCount += bytesRead;
/*    */       }
/* 52 */       out.flush();
/* 53 */       int i = byteCount;
/*    */       return i;
/*    */     } finally {
/*    */       try {
/* 56 */         in.close();
/*    */       } catch (IOException localObject) {
				throw localObject;
/*    */       }
/*    */       try {
/* 60 */         out.close(); 
				} catch (IOException localObject) {
					throw localObject;
/*    */       }
/*    */     }
/* 63 */     
/*    */   }
/*    */ }

/* Location:           C:\Users\lzl6066\Downloads\net.sourceforge.appgen_1.2.0\plugins\net.sourceforge.appgen_1.2.0.201002031718\
 * Qualified Name:     net.sourceforge.appgen.util.FileUtils
 * JD-Core Version:    0.6.0
 */